package com.learning.dynamic.executor.config;

import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.client.config.NacosConfigService;
import com.learning.dynamic.executor.monitor.DynamicExecutorMonitor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;

import java.util.Properties;

/**
 * @author Wang Xu
 * @date 2023/11/7
 */
@Configuration
@ConditionalOnProperty(name = "dynamic.executor.enable", havingValue = "true")
@EnableConfigurationProperties(DynamicProperties.class)
@Import({DynamicExecutorPostProcessor.class, DynamicExecutorImportBeanDefinitionRegistrar.class})
public class DynamicExecutorAutoConfiguration {

    @Bean
    public DynamicExecutorMonitor dynamicExecutorMonitor() {
        return new DynamicExecutorMonitor();
    }

}